
<template>
  <div class="contentBoximg">
    <!-- <div class="banner" ></div> -->
    <div class="logo">
      <img src="../../../assets/Image/netsealogo.png" alt="">
    </div>
    <div class="title">批发商 源头拿货更便宜 加工定制更放心</div>
    <div class="inputBox flex">
      <div class="cur seacrhIconimg">
        <el-icon>
          <Search />
        </el-icon>
      </div>
      <!-- @focus="data.showSearchHistory = true"  @blur="data.showSearchHistory = false" -->
      <input type="text" v-model="search_key" placeholder="请输入商品名称" />
      <div class="seacrhIcon cur seacrhtext" @click="search">
        搜索批发商
      </div>
    </div>

    <div class="typeTitle">所有分类：</div>

    <div class="typeBox">
      <div class="typeItems" v-for="(item, index) in bannerlist" :key="index">
        <div class="itemNames">{{ item.name }}</div>
        <div :class="item.avtiveID == String(jitem.id) ? 'activeitemText' : 'itemText'" @click="SelectType(index, jitem.id,jindex)" v-for="(jitem,jindex) in item.typelist" :key="jindex">{{
    jitem.name
}}
        </div>
      </div>
    </div>

  </div>
</template>
  
<script lang="ts" setup>
import { Search } from '@element-plus/icons-vue'
import { ref, reactive, defineProps,defineEmits } from "vue";
const emit = defineEmits(["SelectType","search"]);
const props = defineProps({
  bannerlist: {
    type: Array as () => Array<any>, //(string也可以是其他你自定义的接口)
    required: true,
    default: () => []
  }
});
const search_key = ref('')

const SelectType = (index: number, id: number,jindex:number) => {
  emit('SelectType',{index,id,jindex})
}
const search = () => {
  emit('search',search_key.value)
}
</script>
  
  
<style scoped lang="less">
.contentBoximg {
  max-width: 1920px;
  height: 600px;
  margin: 0 auto;
  background: #f5f5f5;
  position: relative;
  background: url('../../../assets/Image/factorybanner.png') center center no-repeat;
  background-size: 100% 100%;
  padding: 29px 224px 0;
  box-sizing: border-box;
  margin-bottom: 64px;

  .logo {
    height: 62px;
    display: flex;
    align-items: center;
    margin-bottom: 76px;

    img {
      width: 210px;
      height: 62px;
      z-index: 100;
      display: inline-block;
      margin: 11px;
    }
  }

  .title {
    font-size: 40px;
    font-family: PingFang SC-Medium, PingFang SC;
    font-weight: 500;
    color: #FFFFFF;
    text-align: center;
    line-height: 40px;
    margin: 20px;
  }
}

.inputBox {
  width: 957px;
  height: 64px;

  box-sizing: border-box;
  background-color: #fff;
  margin: 0 auto;
  margin-bottom: 90px;

  input {
    height: 41px;
    flex: 1;
    border: none;
    outline: none;
    font-size: 20px;
  }

  .seacrhtext {
    font-size: 20px;
    font-family: PingFang SC-Medium, PingFang SC;
    font-weight: 500;
    color: #FFFFFF;
    text-align: center;
    line-height: 64px;
  }

  .seacrhIconimg {
    width: 70px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    text-align: center;
    font-weight: normal;
  }

  .seacrhIcon {
    width: 160px;
    height: 64px;
    background: #5C7DCD;
  }
}

.typeTitle {
  font-size: 20px;
  font-family: PingFang SC-Medium, PingFang SC;
  font-weight: 500;
  color: #FFFFFF;
  margin-bottom: 15px;
}
</style>

<style lang="less" scoped>
.typeBox {
  width: 1472px;
  height: 211px;
  background: #FFFFFF;
  padding: 13px 40px 20px;
  box-sizing: border-box;

  .typeItems {
    height: 62px;
    line-height: 62px;
    border-bottom: 1px dashed #ccc;
    display: flex;

    .itemNames {
      font-size: 16px;
      font-family: PingFang SC-Medium, PingFang SC;
      font-weight: 500;
      color: #999999;
      margin-right: 72px;
      cursor: pointer;
    }

    .itemText {
      font-size: 16px;
      font-family: PingFang SC-Medium, PingFang SC;
      font-weight: 500;
      color: #333333;
      margin-right: 60px;
      cursor: pointer;
    }

    .activeitemText {
      font-size: 16px;
      font-family: PingFang SC-Medium, PingFang SC;
      font-weight: 500;
      color: #5C7DCD;
      margin-right: 60px;
      cursor: pointer;
    }
  }

  .typeItems:nth-child(3) {
    border: none;
  }
}
</style>
  